package com.simple.common.entity.constant;

/**
 * 支付相关常量
 *
 * @author yasud
 * @date 2020年09月29日 16:29
 * @description
 */
public class Payment {

    /**
     *国际卡支付产品
     *
     * 代付变量命名必须按照xxx_WITHDRAWAL_CODE 格式
     * 变量值按照xxxWithdrawal
     * 否则导致根据appid 查询产品 接口查不到 任何数据
     */
    public static final String VM_DIRECT_PAY_CODE = "directPay";
    public static final String VM_DIRECT_PAY_2_CODE = "directPay2";

    public static final String VM_REDIRECT_PAY_CODE = "redirectPay";
    public static final String VM_REDIRECT_PAY_2_CODE = "redirectPay2";

    public static final String VM_UPOP_PAY_CODE = "upopPay";

    public static final String VM_QUERY_TRADE_CODE = "queryTrade";
    public static final String VM_REFUND_TRADE_CODE = "refundTrade";

    /**
     * 印度支付代付产品
     */
    public static final String INDIA_PAY_CODE = "indiaPay";
    public static final String INDIA_PAY_QUERY_CODE = "indiaPayQuery";
    public static final String INDIA_WITHDRAWAL_CODE = "indiaWithdrawal";
    public static final String INDIA_WITHDRAWAL_QUERY_CODE = "indiaWithdrawalQuery";

    /**
     * 越南支付代付产品
     */
    public static final String VIETNAM_PAY_CODE = "vietnamPay";
    public static final String VIETNAM_PAY_QUERY_CODE = "vietnamPayQuery";
    public static final String VIETNAM_WITHDRAWAL_CODE = "vietnamWithdrawal";
    public static final String VIETNAM_WITHDRAWAL_QUERY_CODE = "vietnamWithdrawalQuery";

    /**
     * 越南支付代付产品
     */
    public static final String AFRICA_PAY_CODE = "africaPay";
    public static final String AFRICA_PAY_QUERY_CODE = "africaPayQuery";
    public static final String AFRICA_WITHDRAWAL_CODE = "africaWithdrawal";
    public static final String AFRICA_WITHDRAWAL_QUERY_CODE = "africaWithdrawalQuery";
    /**
     * 本地代付产品
     */
    public static final String LOCAL_WITHDRAWAL_CODE = "LocalWithdrawal";
    public static final String LOCAL_WITHDRAWAL_QUERY_CODE = "LocalWithdrawalQuery";


    /**
     * 手动传递跳转，得到交易id
     */
    public static final String REDIRECT_DYNAMIC_CODE = "redirect_dynamic";

    /**
     * 自定义返回内容的跳转，这个跳转必须携带交易id
     */
    public static final String REDIRECT_INFILTRATION_CODE = "redirect_infiltration";

    /**
     * 最终处理
     */
    public static final String REDIRECT_DYNAMIC_FINAL_CODE = "redirect_dynamic_final";

    /**
     * 固定回调 得到orderNo
     */
    public static final String CALLBACK_FIX_CODE = "callFix_order";

    /**
     *  固定回调得到交易id
     */
    public static final String CALLBACK_FIX_TRADE_CODE = "callFix_order_trade";


    /**
     * 地址回调
     */
    public static final String CALLBACK_DYNAMIC_CODE = "callDynamic_order";

    /**
     * 退款动态回调
     */
    public static final String CALLBACK_DYNAMIC_REFUND_CODE = "calldynamic_refund_order";

    /**
     * 回调响应订单号
     */
    public static final String CALLBACK_RES_ORDER_CODE = "callback_res_order";


    /**
     * 退款的固定回调
     */
    public static final String CALLBACK_FIX_REFUND_CODE = "callFix_refund_order";

    /**
     *  退款的固定回调得到交易id
     */
    public static final String CALLBACK_FIX_REFUND_TRADE_CODE = "callFix_refund_order_trade";

    /**
     * 固定回调的Webhook
     */
    public static final String CALLBACK_FIX_WEBHOOK = "callFix_webhook";

    /**
     * 回调响应结果
     */
    public static final String CALLBACK_RES_CODE = "callback_res";

    /**
     * 有些渠道有某些接口获取信息就需要使用
     */
    public static final String INFO_CODE = "info_";


    /**
     * 支付类型
     */
    public enum PAY_TYPE {
        /**
         * 国际卡产品
         */
        VM_DIRECT_PAY_V1(VM_DIRECT_PAY_CODE, "直连支付v1"),
        VM_DIRECT_PAY_V2(VM_DIRECT_PAY_2_CODE, "直连支付v2"),
        VM_REDIRECT_PAY_V1(VM_REDIRECT_PAY_CODE, "跳转支付v1"),
        VM_REDIRECT_PAY_V2(VM_REDIRECT_PAY_2_CODE, "跳转支付v2"),
        VM_UPOP_PAY(VM_UPOP_PAY_CODE, "upop支付"),
        VM_QUERY_TRADE(VM_QUERY_TRADE_CODE, "查询交易"),
        VM_REFUND_TRADE(VM_REFUND_TRADE_CODE, "申请退款"),

        /**
         *印度产品
         */
        INDIA_PAY(INDIA_PAY_CODE, "印度支付"),
        INDIA_PAY_QUERY(INDIA_PAY_QUERY_CODE, "印度支付查询"),
        INDIA_WITHDRAWAL(INDIA_WITHDRAWAL_CODE, "印度代付"),
        INDIA_WITHDRAWAL_QUERY(INDIA_WITHDRAWAL_QUERY_CODE, "印度代付查询"),

        /**
         *越南产品
         */
        VIETNAM_PAY(VIETNAM_PAY_CODE, "越南支付"),
        VIETNAM_PAY_QUERY(VIETNAM_PAY_QUERY_CODE, "越南支付查询"),
        VIETNAM_WITHDRAWAL(VIETNAM_WITHDRAWAL_CODE, "越南代付"),
        VIETNAM_WITHDRAWAL_QUERY(VIETNAM_WITHDRAWAL_QUERY_CODE, "越南代付查询"),

        /**
         *越南产品
         */
        AFRICA_PAY(AFRICA_PAY_CODE, "非洲支付"),
        AFRICA_PAY_QUERY(AFRICA_PAY_QUERY_CODE, "非洲支付查询"),
        AFRICA_WITHDRAWAL(AFRICA_WITHDRAWAL_CODE, "非洲代付"),
        AFRICA_WITHDRAWAL_QUERY(AFRICA_WITHDRAWAL_QUERY_CODE, "非洲代付查询"),

        /**
         *国内产品
         */
        LOCAL_WITHDRAWAL(LOCAL_WITHDRAWAL_CODE, "国内代付"),
        LOCAL_WITHDRAWAL_QUERY(LOCAL_WITHDRAWAL_QUERY_CODE, "国内代付查询"),
        ;
        public String code;
        public String name;

        PAY_TYPE(String code, String name) {
            this.code = code;
            this.name = name;
        }
    }

    /**
     *  订单状态描述
     */
    public static class TRADE_STATUS_DESCRIBE {

        /**
         * 未支付
         */
        public static final String EVEN_SERIAL_STATUS_PAYMENT_UNPAY_MSG = "payment unpay";

        /**
         * 交易已成功
         */
        public static final String EVEN_SERIAL_STATUS_PAYMENT_SUCCESS_MSG = "payment success";

        /**
         * 交易失败
         */
        public static final String EVEN_SERIAL_STATUS_PAYMENT_FAILURE_MSG = "payment failure";

        /**
         * 交易中
         */
        public static final String EVEN_SERIAL_STATUS_PAYMENT_PENDING_MSG = "payment pending";
    }

    /**
     * 直连支付 类型
     */
    public static class DIRECT_PAY_TYPE {

        public static final String DIRECT_PAYMENT_TYPE_2D = "1";


        public static final String DIRECT_PAYMENT_TYPE_3D = "2";
    }
}
